package xyz.zhouzhaodong.crm.controller;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.zhouzhaodong.crm.dto.BusinessIncomeDto;
import xyz.zhouzhaodong.crm.dto.FormDto;
import xyz.zhouzhaodong.crm.entity.BusinessIncome;
import xyz.zhouzhaodong.crm.service.IBusinessIncomeService;
import xyz.zhouzhaodong.crm.util.NoRepeatSubmit;
import xyz.zhouzhaodong.crm.util.RestMessage;

import javax.annotation.Resource;

/**
 * <p>
 * 营业收入 前端控制器
 * </p>
 *
 * @author zhouzhaodong
 * @since 2020-07-03
 */
@RestController
@RequestMapping("/business-income")
public class BusinessIncomeController {

    @Resource
    IBusinessIncomeService businessIncomeService;
    
    /**
     * 新增
     * @param businessIncome
     * @return
     */
    @NoRepeatSubmit
    @RequestMapping("/add")
    public RestMessage addBusinessIncome(BusinessIncome businessIncome){
        return businessIncomeService.addBusinessIncome(businessIncome);
    }

    /**
     * 删除
     * @param businessIncome
     * @return
     */
    @RequestMapping("/delete")
    public RestMessage deleteBusinessIncome(BusinessIncome businessIncome){
        return businessIncomeService.deleteBusinessIncome(businessIncome);
    }

    /**
     * 修改
     * @param businessIncome
     * @return
     */
    @RequestMapping("/update")
    public RestMessage updateBusinessIncome(BusinessIncome businessIncome){
        return businessIncomeService.updateBusinessIncome(businessIncome);
    }

    /**
     * 查询
     * @param businessIncomeDto
     * @return
     */
    @RequestMapping("/select")
    public RestMessage selectBusinessIncome(BusinessIncomeDto businessIncomeDto){
        return businessIncomeService.selectBusinessIncome(businessIncomeDto);
    }

    /**
     * 汇总显示
     * @param formDto
     * @return
     */
    @RequestMapping("/selectCustomerForm")
    public RestMessage selectCustomerForm(FormDto formDto){
        return businessIncomeService.selectCustomerForm(formDto);
    }

}
